package com.lc202407;

import java.util.Arrays;

public class Solution2974 {
    public int[] numberGame(int[] nums) {
        int length = nums.length;
        int[] res = new int[length];
        Arrays.sort(nums);
        for (int i = 0; i < length; i++) {
            if (i % 2 == 0) {
                res[i + 1] = nums[i];
                continue;
            }
            res[i - 1] = nums[i];
        }
        return res;
    }
}
